<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>数学:{{num}}</h1>
        <button v-on:click="add"> + </button>
        <button v-on:click="add2(10)"> 10 </button>
        <button v-on:click="del">-</button>
        <button @click="add2(20)">20</button>
    </div>
    <script src="/js/js/vue.js"></script>
<script>
    var mv=new Vue({
        el:'#app',
        data:{
            num:18
        },
        methods:{
            add:function(){
                this.num++;
            },
            del(){
                this.num--;
            },
            add2(n){
                this.num+=n;
            }
        }
    })
</script>
</body>
</html>